<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Responsive Admin Dashboard Template">
    <meta name="keywords" content="admin,dashboard">
    <meta name="author" content="skcats">
    <!-- The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title>我的课程</title>

    <!-- Styles -->
    <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/icomoon/style.css" rel="stylesheet">

    <link href="${pageContext.request.contextPath}/static/plugins/datatables/css/datatables.jqueryui.min.css"
          rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/ecaps.min.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<!-- Page Container -->
<div class="page-container">
    <!-- Page Sidebar -->
    <div class="page-sidebar">
        <a class="logo-box" href="/tindex.html">
            <span>作业批改系统</span>
            <i class="icon-radio_button_unchecked" id="fixed-sidebar-toggle-button"></i>
            <i class="icon-close" id="sidebar-toggle-button-close"></i>
        </a>
        <div class="page-sidebar-inner">
            <div class="page-sidebar-menu">
                <ul class="accordion-menu">
                    <li>
                        <a href="/tindex.html">
                            <i class="menu-icon icon-inbox"></i><span>首页</span>
                        </a>
                    </li>
                    <li class="active-page">
                        <a href="/tkecheng.html">
                            <i class="menu-icon icon-inbox"></i><span>我的课程</span>
                        </a>
                    </li>
                    <li>
                        <a href="/tkehome.html">
                            <i class="menu-icon icon-inbox"></i><span>课程作业</span>
                        </a>
                    </li>
                    <li>
                        <a href="/thome.html">
                            <i class="menu-icon icon-inbox"></i><span>查看作业</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div><!-- /Page Sidebar -->

    <!-- Page Content -->
    <div class="page-content">
        <!-- Page Header -->
        <div class="page-header">

            <nav class="navbar navbar-default">
                <div class="container-fluid">


                    <!-- Collect the nav links, forms, and other content for toggling -->

<%--                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">--%>
                        <ul class="nav navbar-nav">
                            <li><a href="javascript:void(0)" id="collapsed-sidebar-toggle-button"><i
                                    class="fa fa-bars"></i></a></li>
                            <li><a href="javascript:void(0)" id="toggle-fullscreen"><i class="fa fa-expand"></i></a>
                            </li>
                        </ul>
                        <ul class="nav navbar-nav navbar-right">
                            <li class="dropdown">
                                <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown"
                                   role="button" aria-haspopup="true"
                                   aria-expanded="false"><i class="fa fa-bell"></i></a>
                                <ul class="dropdown-menu dropdown-lg dropdown-content">
                                    <li class="drop-title">Notifications<a href="#" class="drop-title-link"><i
                                            class="fa fa-angle-right"></i></a></li>
                                    <li class="slimscroll dropdown-notifications">
                                        <ul class="list-unstyled dropdown-oc">
                                            <li>
                                                <a href="#"><span class="notification-badge bg-primary"><i
                                                        class="fa fa-photo"></i></span>
                                                    <span class="notification-info">Finished uploading photos to gallery <b>"South Africa"</b>.
																<small class="notification-date">20:00</small>
															</span></a>
                                            </li>
                                            <li>
                                                <a href="#"><span class="notification-badge bg-primary"><i
                                                        class="fa fa-at"></i></span>
                                                    <span class="notification-info"><b>John Doe</b> mentioned you in a post "Update v1.5".
																<small class="notification-date">06:07</small>
															</span></a>
                                            </li>
                                            <li>
                                                <a href="#"><span class="notification-badge bg-danger"><i
                                                        class="fa fa-bolt"></i></span>
                                                    <span class="notification-info">4 new special offers from the apps you follow!
																<small class="notification-date">Yesterday</small>
															</span></a>
                                            </li>
                                            <li>
                                                <a href="#"><span class="notification-badge bg-success"><i
                                                        class="fa fa-bullhorn"></i></span>
                                                    <span class="notification-info">There is a meeting with <b>Ethan</b> in 15 minutes!
																<small class="notification-date">Yesterday</small>
															</span></a>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            <li class="dropdown user-dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                   aria-haspopup="true" aria-expanded="false">张三</a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">Profile</a></li>
                                    <li><a href="#">Calendar</a></li>
                                    <li><a href="#"><span class="badge pull-right badge-danger">42</span>Messages</a>
                                    </li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="#">Account Settings</a></li>
                                    <li><a href="#">Log Out</a></li>
                                </ul>
                            </li>
                        </ul>
<%--                    </div><!-- /.navbar-collapse -->--%>
                </div><!-- /.container-fluid -->
            </nav>
        </div><!-- /Page Header -->
        <!-- Page Inner -->
        <div class="page-inner">
            <div class="page-title">
                <h3 class="breadcrumb-header">我的课程</h3>
            </div>
            <div class="panel panel-white">
                <div class="panel-body">
                    <button type="button" class="btn btn-success" data-toggle="modal" data-target=".bs-example-grid">
                        添加课程
                    </button>
                    <div id="addModal" class="modal fade bs-example-grid" tabindex="-1" role="dialog"
                         aria-labelledby="gridSystemModalLabel">
                        <div class="modal-dialog  modal-md" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                            aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="gridSystemModalLabel">添加课程</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-group">
                                        <label for="className" class="col-sm-3 control-label">课程名称</label>
                                        <div class="col-sm-8">
                                            <input type="text" class="form-control" id="className"
                                                   placeholder="课程名称">
                                            <br>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button id="btn-add-class" type="button" class="btn btn-success">添加</button>
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                    </div><!-- /.modal -->
                </div>
            </div>
            <div id="main-wrapper">
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-white">
                            <div class="panel-heading clearfix">
                                <h4 class="panel-title">Responsive table</h4>
                            </div>
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table id="example2" class="display table" style="width: 100%; cellspacing: 0;">
                                        <thead>
                                        <tr>
                                            <th>课程名称</th>
                                            <th>课程名称</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>

                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div><!-- Row -->
            </div><!-- Main Wrapper -->
<%--            <div class="page-footer">--%>

<%--            </div>--%>
        </div><!-- /Page Inner -->
    </div><!-- /Page Content -->
</div><!-- /Page Container -->


<!-- Javascripts -->
<script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/uniform/js/jquery.uniform.standalone.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/switchery/switchery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datatables/js/jquery.datatables.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/table-data.js"></script>
<script src="${pageContext.request.contextPath}/static/js/ecaps.min.js"></script>
</body>
</html>
<script>
    $(function () {


        $("#btn-add-class").click(function () {
            let className = $("#className").val()
            // alert(className)
            if (className.length > 0) {
                $.ajax({
                    type: "post",
                    dataType: "json",
                    // contentType: "application/json;charset=UTF-8",
                    url: "/teachers/taddclass",
                    data: {
                        className: className
                    },
                    success: function (data) {
                        console.log(data)
                        console.log(data.flag)
                        if (data.flag) {
                            // reg_username.removeClass("form-control is-invalid")
                            // reg_username.addClass("form-control is-valid");
                            // flagName = true;
                            $("#addModal").modal('hide');

                        } else {
                            // $("#name_msg").html(data.msg)
                        }
                    }
                });
            }
        })
    })

    function loadTableData() {


    }

</script>
